<template>
  <el-table
    :data="tableData"
    :default-sort="{ prop: 'date', order: 'descending' }"
    style="width: 100%"
  >
    <el-table-column
      prop="name"
      label="文档名称"
      sortable
    />
    <el-table-column
      prop="createUser"
      label="创建者"
    />
    <el-table-column
      prop="position"
      label="位置"
      :formatter="formatter"
    />
    <el-table-column
      prop="createTime"
      label="创建时间"
    />
    <el-table-column
      prop="updateTime"
      label="更新时间"
    />
    <el-table-column
      prop="operate"
      label="操作"
    >
      <template #default="{ row }">
        <div>
          <el-button
            link
            title="查看"
            icon="View"
            @click="rowView(1, row)"
          ></el-button>
        </div>
      </template>
    </el-table-column>
  </el-table>
</template>

<script setup>

const formatter = (row, column) => {
  return row.position
}

const tableData = [
  {
    name: '12313',
    createUser: '2016-05-03',
    position: 'Tom',
    createTime: 'No. 189, Grove St, Los Angeles',
    updateTime: 'No. 189, Grove St, Los Angeles'
  },
  // {
  //   date: '2016-05-02',
  //   name: 'Tom',
  //   address: 'No. 189, Grove St, Los Angeles',
  // },
  // {
  //   date: '2016-05-04',
  //   name: 'Tom',
  //   address: 'No. 189, Grove St, Los Angeles',
  // },
  // {
  //   date: '2016-05-01',
  //   name: 'Tom',
  //   address: 'No. 189, Grove St, Los Angeles',
  // },
]
</script>
